const path = require('path');

const baseLogPath = path.resolve(__dirname,"../logs");

const errorPath = "/error";
//响应日志路径
const resPath = "/response";

const resFilename = "response";

const errorFilename = "error";
//错误日志输出路径
const errorLogPath = path.join(baseLogPath,errorPath,errorFilename);
//响应日志输出完整路径
const responseLogPath = path.join(baseLogPath,resPath,resFilename);

module.exports = {

	appenders:[{
		//日志名称
		category:"errorLogger",
		//日志类型
		type:"dateFile",
		//日志根路径
		path:errorPath,
		//日志输出位置
		filename:errorLogPath,
		//是否总是有后缀名
		alwaysIncludePattern:true,
		//后缀，每小时创建一个新的日志文件
		pattern: "-yyyy-MM-dd-hh.log"
	},{

		//日志名称
		category:"resLogger",
		//日志类型
		type:"dateFile",
		//日志根目录
		path:resPath,
		//日志输出位置
		filename:responseLogPath,
		//是否总是有后缀名
		alwaysIncludePattern:true,
		//后缀，每小时创建一个新的日志文件
		pattern: "-yyyy-MM-dd-hh.log"

	}],

	levels:{

		errorLogger:"ERROR",
		resLogger:"ALL"

	},

	baseLogPath
}